

<!DOCTYPE html>
<html lang="zh-CN" data-default-color-scheme=auto>



<head>
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" sizes="76x76" href="/img/fluid.png">
  <link rel="icon" href="/img/fluid.png">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
  <meta name="theme-color" content="#2f4154">
  <meta name="author" content="John Doe">
  <meta name="keywords" content="">
  
    <meta name="description" content="笔者：unirithe 日期：11&#x2F;13&#x2F;2021 注：本篇博文不涉及Hadoop节点的配置 运行环境 Windwos10操作系统 VMware Workstation 15.5 Pro （网上有许多资源，下载过程略过） CentOS7虚拟机系统@[toc]CentOS7 镜像下载  http:&#x2F;&#x2F;mirrors.aliyun.com&#x2F;centos&#x2F;7.9.2009&#x2F;isos&#x2F;">
<meta property="og:type" content="article">
<meta property="og:title" content="Hadoop集群搭建 _ 使用3台CentOS7系统的虚拟机搭建Hadoop完全分布式集群多节点的纯净系统">
<meta property="og:url" content="http://example.com/2021/11/13/Hadoop%E9%9B%86%E7%BE%A4%E6%90%AD%E5%BB%BA%20_%20%E4%BD%BF%E7%94%A83%E5%8F%B0CentOS7%E7%B3%BB%E7%BB%9F%E7%9A%84%E8%99%9A%E6%8B%9F%E6%9C%BA%E6%90%AD%E5%BB%BAHadoop%E5%AE%8C%E5%85%A8%E5%88%86%E5%B8%83%E5%BC%8F%E9%9B%86%E7%BE%A4%E5%A4%9A%E8%8A%82%E7%82%B9%E7%9A%84%E7%BA%AF%E5%87%80%E7%B3%BB%E7%BB%9F/index.html">
<meta property="og:site_name" content="Hexo">
<meta property="og:description" content="笔者：unirithe 日期：11&#x2F;13&#x2F;2021 注：本篇博文不涉及Hadoop节点的配置 运行环境 Windwos10操作系统 VMware Workstation 15.5 Pro （网上有许多资源，下载过程略过） CentOS7虚拟机系统@[toc]CentOS7 镜像下载  http:&#x2F;&#x2F;mirrors.aliyun.com&#x2F;centos&#x2F;7.9.2009&#x2F;isos&#x2F;">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://img-blog.csdnimg.cn/4d68b5f2887f4e06a0af08735ec2c67b.png#pic_center">
<meta property="og:image" content="https://img-blog.csdnimg.cn/4e8252913f9a405f83c2e17dfbec604c.png#pic_center">
<meta property="og:image" content="https://img-blog.csdnimg.cn/0998f2b34b274fc79c8092d45139b40e.png#pic_center">
<meta property="og:image" content="https://img-blog.csdnimg.cn/d47048d3648447c4a966a26f7c105bfd.png#pic_center">
<meta property="og:image" content="https://img-blog.csdnimg.cn/a4315ddd0e5e44e3891f198a07ee0d05.png#pic_center">
<meta property="og:image" content="https://img-blog.csdnimg.cn/3e23a54a99d64dfbb64155e98822960f.png#pic_center">
<meta property="og:image" content="https://img-blog.csdnimg.cn/8c4784f6839e42eb894c1e2cbe246770.png#pic_center">
<meta property="og:image" content="https://img-blog.csdnimg.cn/3bd87a72eded42348d721567801fa038.png#pic_center">
<meta property="og:image" content="https://img-blog.csdnimg.cn/396639fb579b43c69713cd5a7bc33d29.png#pic_center">
<meta property="og:image" content="https://img-blog.csdnimg.cn/9fa799cf717b4994966831e0d91838f2.png#pic_center">
<meta property="og:image" content="https://img-blog.csdnimg.cn/66621fcee1e1418196efc89b23208ab7.png#pic_center">
<meta property="og:image" content="https://img-blog.csdnimg.cn/d2b47227f31048b9b8ad3919cb75bb5d.png#pic_center">
<meta property="og:image" content="https://img-blog.csdnimg.cn/a8ba7cec6d744979a8b3f2d3e57e185c.png#pic_center">
<meta property="og:image" content="https://img-blog.csdnimg.cn/b79cef4a919c4d82a5879b8202ece27c.png#pic_center">
<meta property="og:image" content="https://img-blog.csdnimg.cn/b0db93b585914918931618cdefe22653.png#pic_center">
<meta property="og:image" content="https://img-blog.csdnimg.cn/83096e01e13244219fbb23aad42f8d2d.png#pic_center">
<meta property="og:image" content="https://img-blog.csdnimg.cn/85ea819a475c4d93b31b05fdf2d90ad9.png#pic_center">
<meta property="og:image" content="https://img-blog.csdnimg.cn/aa6c518a817f4301bee0dd83c83c0b01.png#pic_center">
<meta property="og:image" content="https://img-blog.csdnimg.cn/76417577fab4486ba01580fd4ab1d55a.png#pic_center">
<meta property="og:image" content="https://img-blog.csdnimg.cn/e557eaa3f2a941cea336bf642efbb7e4.png#pic_center">
<meta property="og:image" content="https://img-blog.csdnimg.cn/d6f7a920ef47472ab0ec30df3bb88306.png#pic_center">
<meta property="og:image" content="https://img-blog.csdnimg.cn/c6e0b0c6d2f84cc09860b2070c3849c0.png#pic_center">
<meta property="og:image" content="https://img-blog.csdnimg.cn/b3e0c77e90f24500bb7c2022a8a90dcc.png#pic_center">
<meta property="og:image" content="https://img-blog.csdnimg.cn/cf431f4ead2d48679a51d2b6103debc7.png#pic_center">
<meta property="og:image" content="https://img-blog.csdnimg.cn/ab94c5b0bb184a86b19f29f1291bfce1.png#pic_center">
<meta property="og:image" content="https://img-blog.csdnimg.cn/100d0037aba841a9a5b6c820cdce3935.png#pic_center">
<meta property="og:image" content="https://img-blog.csdnimg.cn/2afaabfefc8a4433b7c9ebdad8f1ead6.png#pic_center">
<meta property="og:image" content="https://img-blog.csdnimg.cn/6eab9dfdb09f490a8f62eee3f242b479.png#pic_center">
<meta property="og:image" content="https://img-blog.csdnimg.cn/6b5576df28d74ff48c83d036e3994d11.png#pic_center">
<meta property="og:image" content="https://img-blog.csdnimg.cn/4852bb2d37f74365be62992f0265646f.png#pic_center">
<meta property="og:image" content="https://img-blog.csdnimg.cn/ac8de4c00d614db39268debaf6705085.png#pic_center">
<meta property="og:image" content="https://img-blog.csdnimg.cn/e20cb8a3923d41a28f1d340bb9ea1bc0.png#pic_center">
<meta property="og:image" content="https://img-blog.csdnimg.cn/dcb758bff22246b48f32b32f27396e2a.png#pic_center">
<meta property="og:image" content="https://img-blog.csdnimg.cn/0ec029ddbfd649138de39419a15498fb.png#pic_center">
<meta property="og:image" content="https://img-blog.csdnimg.cn/26cb8a59cb594d84918287f89d1a38c3.png#pic_center">
<meta property="og:image" content="https://img-blog.csdnimg.cn/33ffa28934544b88844ddf7c79538a71.png#pic_center">
<meta property="og:image" content="https://img-blog.csdnimg.cn/55f6cee501164c41932b52ce3b9ec1f0.png#pic_center">
<meta property="og:image" content="https://img-blog.csdnimg.cn/2e34487c3d094ac2a6258edb7f1ddcb7.png#pic_center">
<meta property="og:image" content="https://img-blog.csdnimg.cn/234441971be947d69cc496c0ecc10af7.png#pic_center">
<meta property="og:image" content="https://img-blog.csdnimg.cn/142876ebe1154148a18900c5f8c5dc76.png#pic_center">
<meta property="article:published_time" content="2021-11-13T14:43:18.000Z">
<meta property="article:modified_time" content="2022-08-22T15:44:34.163Z">
<meta property="article:author" content="John Doe">
<meta property="article:tag" content="Hadoop">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="https://img-blog.csdnimg.cn/4d68b5f2887f4e06a0af08735ec2c67b.png#pic_center">
  
  
  
  <title>Hadoop集群搭建 _ 使用3台CentOS7系统的虚拟机搭建Hadoop完全分布式集群多节点的纯净系统 - Hexo</title>

  <link  rel="stylesheet" href="https://lib.baomitu.com/twitter-bootstrap/4.6.1/css/bootstrap.min.css" />



  <link  rel="stylesheet" href="https://lib.baomitu.com/github-markdown-css/4.0.0/github-markdown.min.css" />

  <link  rel="stylesheet" href="https://lib.baomitu.com/hint.css/2.7.0/hint.min.css" />

  <link  rel="stylesheet" href="https://lib.baomitu.com/fancybox/3.5.7/jquery.fancybox.min.css" />



<!-- 主题依赖的图标库，不要自行修改 -->
<!-- Do not modify the link that theme dependent icons -->

<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_hj8rtnfg7um.css">



<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_lbnruvf0jn.css">


<link  rel="stylesheet" href="/css/main.css" />


  <link id="highlight-css" rel="stylesheet" href="/css/highlight.css" />
  
    <link id="highlight-css-dark" rel="stylesheet" href="/css/highlight-dark.css" />
  




  <script id="fluid-configs">
    var Fluid = window.Fluid || {};
    Fluid.ctx = Object.assign({}, Fluid.ctx)
    var CONFIG = {"hostname":"example.com","root":"/","version":"1.9.2","typing":{"enable":true,"typeSpeed":70,"cursorChar":"_","loop":false,"scope":[]},"anchorjs":{"enable":true,"element":"h1,h2,h3,h4,h5,h6","placement":"left","visible":"hover","icon":""},"progressbar":{"enable":true,"height_px":3,"color":"#29d","options":{"showSpinner":false,"trickleSpeed":100}},"code_language":{"enable":true,"default":"TEXT"},"copy_btn":true,"image_caption":{"enable":true},"image_zoom":{"enable":true,"img_url_replace":["",""]},"toc":{"enable":true,"placement":"right","headingSelector":"h1,h2,h3,h4,h5,h6","collapseDepth":0},"lazyload":{"enable":true,"loading_img":"/img/loading.gif","onlypost":false,"offset_factor":2},"web_analytics":{"enable":false,"follow_dnt":true,"baidu":null,"google":null,"gtag":null,"tencent":{"sid":null,"cid":null},"woyaola":null,"cnzz":null,"leancloud":{"app_id":null,"app_key":null,"server_url":null,"path":"window.location.pathname","ignore_local":false}},"search_path":"/local-search.xml"};

    if (CONFIG.web_analytics.follow_dnt) {
      var dntVal = navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack;
      Fluid.ctx.dnt = dntVal && (dntVal.startsWith('1') || dntVal.startsWith('yes') || dntVal.startsWith('on'));
    }
  </script>
  <script  src="/js/utils.js" ></script>
  <script  src="/js/color-schema.js" ></script>
  


  
<meta name="generator" content="Hexo 6.2.0"></head>


<body>
  

  <header>
    

<div class="header-inner" style="height: 70vh;">
  <nav id="navbar" class="navbar fixed-top  navbar-expand-lg navbar-dark scrolling-navbar">
  <div class="container">
    <a class="navbar-brand" href="/">
      <strong>尤 Ni&#39;s Blog</strong>
    </a>

    <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <div class="animated-icon"><span></span><span></span><span></span></div>
    </button>

    <!-- Collapsible content -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav ml-auto text-center">
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/">
                <i class="iconfont icon-home-fill"></i>
                首页
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/archives/">
                <i class="iconfont icon-archive-fill"></i>
                归档
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/categories/">
                <i class="iconfont icon-category-fill"></i>
                分类
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/tags/">
                <i class="iconfont icon-tags-fill"></i>
                标签
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/about/">
                <i class="iconfont icon-user-fill"></i>
                关于
              </a>
            </li>
          
        
        
          <li class="nav-item" id="search-btn">
            <a class="nav-link" target="_self" href="javascript:;" data-toggle="modal" data-target="#modalSearch" aria-label="Search">
              &nbsp;<i class="iconfont icon-search"></i>&nbsp;
            </a>
          </li>
          
        
        
          <li class="nav-item" id="color-toggle-btn">
            <a class="nav-link" target="_self" href="javascript:;" aria-label="Color Toggle">&nbsp;<i
                class="iconfont icon-dark" id="color-toggle-icon"></i>&nbsp;</a>
          </li>
        
      </ul>
    </div>
  </div>
</nav>

  

<div id="banner" class="banner" parallax=true
     style="background: url('/img/default.png') no-repeat center center; background-size: cover;">
  <div class="full-bg-img">
    <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
      <div class="banner-text text-center fade-in-up">
        <div class="h2">
          
            <span id="subtitle" data-typed-text="Hadoop集群搭建 _ 使用3台CentOS7系统的虚拟机搭建Hadoop完全分布式集群多节点的纯净系统"></span>
          
        </div>

        
          
  <div class="mt-3">
    
      <span class="post-meta mr-2">
        <i class="iconfont icon-author" aria-hidden="true"></i>
        John Doe
      </span>
    
    
      <span class="post-meta">
        <i class="iconfont icon-date-fill" aria-hidden="true"></i>
        <time datetime="2021-11-13 22:43" pubdate>
          2021年11月13日 晚上
        </time>
      </span>
    
  </div>

  <div class="mt-1">
    
      <span class="post-meta mr-2">
        <i class="iconfont icon-chart"></i>
        
          2.7k 字
        
      </span>
    

    
      <span class="post-meta mr-2">
        <i class="iconfont icon-clock-fill"></i>
        
        
        
          23 分钟
        
      </span>
    

    
    
  </div>


        
      </div>

      
    </div>
  </div>
</div>

</div>

  </header>

  <main>
    
      

<div class="container-fluid nopadding-x">
  <div class="row nomargin-x">
    <div class="side-col d-none d-lg-block col-lg-2">
      

    </div>

    <div class="col-lg-8 nopadding-x-md">
      <div class="container nopadding-x-md" id="board-ctn">
        <div id="board">
          <article class="post-content mx-auto">
            <!-- SEO header -->
            <h1 style="display: none">Hadoop集群搭建 _ 使用3台CentOS7系统的虚拟机搭建Hadoop完全分布式集群多节点的纯净系统</h1>
            
              <p class="note note-info">
                
                  
                    本文最后更新于：1 小时前
                  
                
              </p>
            
            
              <div class="markdown-body">
                
                <p>笔者：unirithe</p>
<p>日期：11&#x2F;13&#x2F;2021</p>
<p>注：本篇博文不涉及Hadoop节点的配置</p>
<h1 id="运行环境"><a href="#运行环境" class="headerlink" title="运行环境"></a>运行环境</h1><ul>
<li>Windwos10操作系统</li>
<li>VMware Workstation 15.5 Pro （网上有许多资源，下载过程略过）</li>
<li>CentOS7虚拟机系统<br>@[toc]<br>CentOS7 镜像下载</li>
</ul>
<p><a target="_blank" rel="noopener" href="http://mirrors.aliyun.com/centos/7.9.2009/isos/x86_64/CentOS-7-x86_64-DVD-2009.iso">http://mirrors.aliyun.com/centos/7.9.2009/isos/x86_64&#x2F;CentOS-7-x86_64-DVD-2009.iso</a></p>
<h1 id="一、创建并配置虚拟机"><a href="#一、创建并配置虚拟机" class="headerlink" title="一、创建并配置虚拟机"></a>一、创建并配置虚拟机</h1><hr>
<p>打开VMware 工具，Ctrl + N 新建虚拟机</p>
<p><img src="https://img-blog.csdnimg.cn/4d68b5f2887f4e06a0af08735ec2c67b.png#pic_center" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
<p>选择下载好的iso系统镜像，点击下一步</p>
<p><img src="https://img-blog.csdnimg.cn/4e8252913f9a405f83c2e17dfbec604c.png#pic_center" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
<p>设置虚拟机名称，以hadoop为例</p>
<p><img src="https://img-blog.csdnimg.cn/0998f2b34b274fc79c8092d45139b40e.png#pic_center" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
<p>分配40GB的磁盘</p>
<p><img src="https://img-blog.csdnimg.cn/d47048d3648447c4a966a26f7c105bfd.png#pic_center" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
<p>在创建后开启此虚拟机处取消打钩，最后点击完成</p>
<p><img src="https://img-blog.csdnimg.cn/a4315ddd0e5e44e3891f198a07ee0d05.png#pic_center" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
<p>接下来设置虚拟机硬件配置</p>
<p><img src="https://img-blog.csdnimg.cn/3e23a54a99d64dfbb64155e98822960f.png#pic_center" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
<p>根据自身电脑配置，对虚拟机配置进行修改，比如笔者的笔记本配置是16G内存和8核的处理器，所以可以分配如下内存4GB + 处理器2*2 ，之后可以随时修改，只要确保虚拟机配置低于本机即可</p>
<p><img src="https://img-blog.csdnimg.cn/8c4784f6839e42eb894c1e2cbe246770.png#pic_center" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
<p>设置完毕后，开启此虚拟机，首次进入系统需要进行安装，如下图所示<br><img src="https://img-blog.csdnimg.cn/3bd87a72eded42348d721567801fa038.png#pic_center" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
<p>在虚拟机里按方向键，选择第一个选项，回车</p>
<p>（Tips：Ctrl + Alt + Z 热键可以从虚拟机中弹出鼠标）</p>
<h1 id="二、配置CentOS7系统"><a href="#二、配置CentOS7系统" class="headerlink" title="二、配置CentOS7系统"></a>二、配置CentOS7系统</h1><hr>
<h2 id="2-1-设置语言"><a href="#2-1-设置语言" class="headerlink" title="2.1 设置语言"></a>2.1 设置语言</h2><p>首次进入系统，需要设置语言，选择Chinese后点击继续</p>
<p><img src="https://img-blog.csdnimg.cn/396639fb579b43c69713cd5a7bc33d29.png#pic_center" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
<h2 id="2-2-设置GNOME桌面环境"><a href="#2-2-设置GNOME桌面环境" class="headerlink" title="2.2 设置GNOME桌面环境"></a>2.2 设置GNOME桌面环境</h2><p>点击<code>基本环境</code>，选择 <code>GNOME桌面</code></p>
<p><img src="https://img-blog.csdnimg.cn/9fa799cf717b4994966831e0d91838f2.png#pic_center" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
<h2 id="2-3-手动配置系统的分区"><a href="#2-3-手动配置系统的分区" class="headerlink" title="2.3 手动配置系统的分区"></a>2.3 手动配置系统的分区</h2><p>第一个分区&#x2F;boot ，作为启动系统所占用的空间，文件系统类型为 ext4，容量1G</p>
<p><img src="https://img-blog.csdnimg.cn/66621fcee1e1418196efc89b23208ab7.png#pic_center" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
<p>第二个分区 &#x2F; ，存放系统运行时的所有文件，文件系统类型为 <code>xfs</code> ，容量35G</p>
<p><img src="https://img-blog.csdnimg.cn/d2b47227f31048b9b8ad3919cb75bb5d.png#pic_center" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
<p>第三个分区 &#x2F;swap，容量4G</p>
<p><img src="https://img-blog.csdnimg.cn/a8ba7cec6d744979a8b3f2d3e57e185c.png#pic_center" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
<h2 id="2-4-配置网络和主机名"><a href="#2-4-配置网络和主机名" class="headerlink" title="2.4 配置网络和主机名"></a>2.4 配置网络和主机名</h2><p><img src="https://img-blog.csdnimg.cn/b79cef4a919c4d82a5879b8202ece27c.png#pic_center" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
<h2 id="2-5-创建系统用户和密码"><a href="#2-5-创建系统用户和密码" class="headerlink" title="2.5 创建系统用户和密码"></a>2.5 创建系统用户和密码</h2><p>创建用户</p>
<p><img src="https://img-blog.csdnimg.cn/b0db93b585914918931618cdefe22653.png#pic_center" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
<p>设置密码</p>
<p><img src="https://img-blog.csdnimg.cn/83096e01e13244219fbb23aad42f8d2d.png#pic_center" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
<p>密码较弱的话点击两次完成即可，接着需要等待一段时间，等系统安装基本工具</p>
<p><img src="https://img-blog.csdnimg.cn/85ea819a475c4d93b31b05fdf2d90ad9.png#pic_center" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
<p>完成后重启即可</p>
<p><img src="https://img-blog.csdnimg.cn/aa6c518a817f4301bee0dd83c83c0b01.png#pic_center" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
<h1 id="三、配置虚拟机网络"><a href="#三、配置虚拟机网络" class="headerlink" title="三、配置虚拟机网络"></a>三、配置虚拟机网络</h1><hr>
<h2 id="3-1-VMware工具修改网络配置"><a href="#3-1-VMware工具修改网络配置" class="headerlink" title="3.1 VMware工具修改网络配置"></a>3.1 VMware工具修改网络配置</h2><p>首先打开虚拟网络编辑器</p>
<p><img src="https://img-blog.csdnimg.cn/76417577fab4486ba01580fd4ab1d55a.png#pic_center" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
<p>修改VMnet8的子网IP，其中的25可以是任意3位数</p>
<p><img src="https://img-blog.csdnimg.cn/e557eaa3f2a941cea336bf642efbb7e4.png#pic_center" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
<p> 在NAT设置中，将网关IP的第三个三位数改成与刚刚的子网IP相对应，最后一位固定为2</p>
<p><img src="https://img-blog.csdnimg.cn/d6f7a920ef47472ab0ec30df3bb88306.png#pic_center" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
<h2 id="3-2-配置Windows本机的虚拟机网络"><a href="#3-2-配置Windows本机的虚拟机网络" class="headerlink" title="3.2 配置Windows本机的虚拟机网络"></a>3.2 配置Windows本机的虚拟机网络</h2><p>打开 控制面板 -&gt; 网络和 Internet -&gt; 网络连接</p>
<p><img src="https://img-blog.csdnimg.cn/c6e0b0c6d2f84cc09860b2070c3849c0.png#pic_center" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
<p>双击协议版本4，修改其中的IP地址、默认网关和首选DNS服务器，如下图所示，注意25是自定义的值，其他的需固定</p>
<p><img src="https://img-blog.csdnimg.cn/b3e0c77e90f24500bb7c2022a8a90dcc.png#pic_center" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
<h2 id="3-3-配置-CentOS-7-系统的网络"><a href="#3-3-配置-CentOS-7-系统的网络" class="headerlink" title="3.3 配置 CentOS 7 系统的网络"></a>3.3 配置 CentOS 7 系统的网络</h2><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs shell">su root<br><br>vim /etc/sysconfig/network-scripts/ifcfg-ens33<br></code></pre></td></tr></table></figure>

<p>将<code>BOOTPROTO</code>的属性值改为<code>static</code> 表示固定IP，<code>OBOOT</code>属性设置为yes，并在末尾添加以下内容</p>
<figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs sh">IPADDR=192.168.25.99<br>GATEWAY=192.168.25.2<br>DNS1=192.168.25.2<br></code></pre></td></tr></table></figure>

<p><img src="https://img-blog.csdnimg.cn/cf431f4ead2d48679a51d2b6103debc7.png#pic_center" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
<h2 id="3-4-配置-CentOS7-主机名和域名映射"><a href="#3-4-配置-CentOS7-主机名和域名映射" class="headerlink" title="3.4 配置 CentOS7 主机名和域名映射"></a>3.4 配置 CentOS7 主机名和域名映射</h2><p>修改主机名为hadoop</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs shell">vim /etc/hostname<br></code></pre></td></tr></table></figure>

<p>修改hosts</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs shell">vim /etc/hosts<br></code></pre></td></tr></table></figure>

<p>添加如下内容：</p>
<figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs sh">192.168.25.101 hadoop101<br>192.168.25.102 hadoop102<br>192.168.25.103 hadoop103<br></code></pre></td></tr></table></figure>

<p>其中的hadoop101、hadoop102、hadoop103是等会克隆出来的虚拟机</p>
<p>配置完毕后，使用<code>reboot</code>命令重启该虚拟机 </p>
<p>重启后输入<code>ifconfig</code> 查看虚拟机IP信息</p>
<p><img src="https://img-blog.csdnimg.cn/ab94c5b0bb184a86b19f29f1291bfce1.png#pic_center" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
<p>查看网络是否连接成功 <code>ping www.baidu.com</code> (Ctrl + Z 停止)</p>
<p><img src="https://img-blog.csdnimg.cn/100d0037aba841a9a5b6c820cdce3935.png#pic_center" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
<p>至此，单台虚拟机的IP配置已完成.</p>
<h1 id="附加：XShell-远程操作"><a href="#附加：XShell-远程操作" class="headerlink" title="附加：XShell 远程操作"></a>附加：XShell 远程操作</h1><p>为什么要使用远程登录？</p>
<p>举例： 在公司开发的时候，具体的应用场景</p>
<ol>
<li><a target="_blank" rel="noopener" href="https://so.csdn.net/so/search?from=pc_blog_highlight&q=LInux">LInux</a> 服务器是开发小组共享</li>
<li>正式上线的项目是运行在公网</li>
<li>程序员需远程登陆到Linux进行项目管理或开发</li>
</ol>
<p>XShell的安装可以参考 <a target="_blank" rel="noopener" href="https://blog.csdn.net/Unirithe/article/details/117232089?spm=1001.2014.3001.5501">链接</a>，这里只提供基本使用的教学</p>
<p>新建会话，用于连接虚拟机，当然也可以连接远程的服务器</p>
<p><img src="https://img-blog.csdnimg.cn/2afaabfefc8a4433b7c9ebdad8f1ead6.png#pic_center" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
<p>连接首先配置两个参数，一是可自定义的名称，二是和虚拟机对应的主机IP，端口号默认为22。<br><img src="https://img-blog.csdnimg.cn/6eab9dfdb09f490a8f62eee3f242b479.png#pic_center" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"><br>连接后，在左侧栏双击该会话，首次进入需要设置登陆的用户名和密码<br><img src="https://img-blog.csdnimg.cn/6b5576df28d74ff48c83d036e3994d11.png#pic_center" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
<p>为方便下次打开，可点击记住用户名、记住密码，若更改了用户可再次修改，无需担心<br><img src="https://img-blog.csdnimg.cn/4852bb2d37f74365be62992f0265646f.png#pic_center" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"><br>首次连接成功的结果<img src="https://img-blog.csdnimg.cn/ac8de4c00d614db39268debaf6705085.png#pic_center" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
<p>使用提示：</p>
<ul>
<li><p>快速放大终端字体，按住Ctrl，滑动鼠标滚轮</p>
</li>
<li><p>设置终端的外观</p>
</li>
</ul>
<p><img src="https://img-blog.csdnimg.cn/e20cb8a3923d41a28f1d340bb9ea1bc0.png#pic_center" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
<p>在左侧栏点击外观，然后选择自己喜欢的配色方案、字体等属性，设置好后点击确定即可</p>
<p><img src="https://img-blog.csdnimg.cn/dcb758bff22246b48f32b32f27396e2a.png#pic_center" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
<p>设置完毕后需要重新连接 会话 才有效果，重新开启一个终端只需要双击左侧的主机</p>
<p><img src="https://img-blog.csdnimg.cn/0ec029ddbfd649138de39419a15498fb.png#pic_center" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
<h1 id="四、克隆虚拟机"><a href="#四、克隆虚拟机" class="headerlink" title="四、克隆虚拟机"></a>四、克隆虚拟机</h1><hr>
<h2 id="4-1-前期准备"><a href="#4-1-前期准备" class="headerlink" title="4.1 前期准备"></a>4.1 前期准备</h2><p>克隆前，确保系统可正确使用yum命令，其次是防火墙需关闭，因为在Hadoop完全分布式中，各个节点会经常互相连接访问，它们之间无需防火墙。</p>
<p>其次是创建一个用户，这样保证克隆出的虚拟机都有同一个用户，方便操作。</p>
<ul>
<li>安装 epel-release</li>
</ul>
<p>注：epel全称是Extra Packages for Enteprise Linux 是为红帽系的操作系统提供额外的软件包，相当于软件仓库，因为大多数rpm包在原来官方的repository找不到。</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><code class="hljs shell">su root<br>yum install -y epel-release<br>yum install -y net-tools<br>yum install -y vim<br></code></pre></td></tr></table></figure>

<ul>
<li>关闭防火墙 以及开机自启</li>
</ul>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs shell">systemctl stop firewalled<br>systemctl disable firewalld.service<br></code></pre></td></tr></table></figure>

<ul>
<li>创建自用的用户</li>
</ul>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs shell">useradd uni<br>passwd uni<br></code></pre></td></tr></table></figure>

<ul>
<li>添加用户到权限组</li>
</ul>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs shell">vim/etc/sudoers<br></code></pre></td></tr></table></figure>

<p>添加 一行内容</p>
<p><code>用户名	ALL=(ALL) 	NOPASSWD:ALL</code></p>
<p><img src="https://img-blog.csdnimg.cn/26cb8a59cb594d84918287f89d1a38c3.png#pic_center" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
<p>注：设置免密，为什么不直接放在root下面？</p>
<p>因为所有用户都属于wheel组，我们配置自己的用户免密登陆，但执行到%wheel那行时，该功能又被覆盖掉了，所以得放在%wheel后面</p>
<p>接着在XShell 更改用户名</p>
<p><img src="https://img-blog.csdnimg.cn/33ffa28934544b88844ddf7c79538a71.png#pic_center" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
<h2 id="4-2-克隆虚拟机"><a href="#4-2-克隆虚拟机" class="headerlink" title="4.2 克隆虚拟机"></a>4.2 克隆虚拟机</h2><p>克隆虚拟机前需将其关闭</p>
<p><img src="https://img-blog.csdnimg.cn/55f6cee501164c41932b52ce3b9ec1f0.png#pic_center" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"><br>克隆方法选择 <code>创建完整克隆</code><br><img src="https://img-blog.csdnimg.cn/2e34487c3d094ac2a6258edb7f1ddcb7.png#pic_center" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"><br><img src="https://img-blog.csdnimg.cn/234441971be947d69cc496c0ecc10af7.png#pic_center" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
<p>同样的操作再克隆两台，克隆完毕后，逐一配置克隆机的IP和用户（注：同时开启IP会冲突）</p>
<p>以hadoop101为例，配置克隆机的IP</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs shell">su root<br>vim /etc/sysconfig/network-scripts/ifcfg-ens33<br></code></pre></td></tr></table></figure>

<p>只需修改IPADDR属性，如下图所示，根据主机名hadoop101，将IP最后三位设置为101即可</p>
<p><img src="https://img-blog.csdnimg.cn/142876ebe1154148a18900c5f8c5dc76.png#pic_center" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
<p>修改主机名</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs shell">vim /etc/hostname<br><span class="hljs-meta prompt_"># </span><span class="language-bash">输入内容 hadoop101即可</span><br></code></pre></td></tr></table></figure>
<p>至此，使用VMware创建的3个Hadoop节点基于CentOS 7系统的纯净环境已完成.</p>

                
              </div>
            
            <hr/>
            <div>
              <div class="post-metas my-3">
  
    <div class="post-meta mr-3 d-flex align-items-center">
      <i class="iconfont icon-category"></i>
      

<span class="category-chains">
  
  
    
      <span class="category-chain">
        
  <a href="/categories/%E5%A4%A7%E6%95%B0%E6%8D%AE/" class="category-chain-item">大数据</a>
  
  

      </span>
    
  
</span>

    </div>
  
  
    <div class="post-meta">
      <i class="iconfont icon-tags"></i>
      
        <a href="/tags/Hadoop/">#Hadoop</a>
      
    </div>
  
</div>


              
  

  <div class="license-box my-3">
    <div class="license-title">
      <div>Hadoop集群搭建 _ 使用3台CentOS7系统的虚拟机搭建Hadoop完全分布式集群多节点的纯净系统</div>
      <div>http://example.com/2021/11/13/Hadoop集群搭建 _ 使用3台CentOS7系统的虚拟机搭建Hadoop完全分布式集群多节点的纯净系统/</div>
    </div>
    <div class="license-meta">
      
        <div class="license-meta-item">
          <div>作者</div>
          <div>John Doe</div>
        </div>
      
      
        <div class="license-meta-item license-meta-date">
          <div>发布于</div>
          <div>2021年11月13日</div>
        </div>
      
      
      <div class="license-meta-item">
        <div>许可协议</div>
        <div>
          
            
            
              <a target="_blank" href="https://creativecommons.org/licenses/by/4.0/">
              <span class="hint--top hint--rounded" aria-label="BY - 署名">
                <i class="iconfont icon-by"></i>
              </span>
              </a>
            
          
        </div>
      </div>
    </div>
    <div class="license-icon iconfont"></div>
  </div>



              
                <div class="post-prevnext my-3">
                  <article class="post-prev col-6">
                    
                    
                      <a href="/2021/11/21/Java%20_%20Comparable%E6%8E%A5%E5%8F%A3%E4%B8%8EComparator%E6%8E%A5%E5%8F%A3%E7%9A%84%E6%B7%B1%E5%85%A5%E7%90%86%E8%A7%A3%20_%20%E6%9C%89%E5%85%B3%E6%8E%92%E5%BA%8F%E7%9A%84%E9%83%BD%E4%BC%9A%E7%94%A8%E5%88%B0/" title="Java _ Comparable接口与Comparator接口的深入理解 _ 有关排序的都会用到">
                        <i class="iconfont icon-arrowleft"></i>
                        <span class="hidden-mobile">Java _ Comparable接口与Comparator接口的深入理解 _ 有关排序的都会用到</span>
                        <span class="visible-mobile">上一篇</span>
                      </a>
                    
                  </article>
                  <article class="post-next col-6">
                    
                    
                      <a href="/2021/11/03/HTML%20_%20%E5%9F%BA%E4%BA%8EBoostrap3%E5%AE%9E%E7%8E%B0%E5%AF%BC%E8%88%AA%E6%A0%8F%E5%88%87%E6%8D%A2%E6%95%88%E6%9E%9C/" title="HTML _ 基于Boostrap3实现导航栏切换效果">
                        <span class="hidden-mobile">HTML _ 基于Boostrap3实现导航栏切换效果</span>
                        <span class="visible-mobile">下一篇</span>
                        <i class="iconfont icon-arrowright"></i>
                      </a>
                    
                  </article>
                </div>
              
            </div>

            
          </article>
        </div>
      </div>
    </div>

    <div class="side-col d-none d-lg-block col-lg-2">
      
  <aside class="sidebar" style="margin-left: -1rem">
    <div id="toc">
  <p class="toc-header"><i class="iconfont icon-list"></i>&nbsp;目录</p>
  <div class="toc-body" id="toc-body"></div>
</div>



  </aside>


    </div>
  </div>
</div>





  



  



  



  



  







    

    
      <a id="scroll-top-button" aria-label="TOP" href="#" role="button">
        <i class="iconfont icon-arrowup" aria-hidden="true"></i>
      </a>
    

    
      <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
     aria-hidden="true">
  <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header text-center">
        <h4 class="modal-title w-100 font-weight-bold">搜索</h4>
        <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body mx-3">
        <div class="md-form mb-5">
          <input type="text" id="local-search-input" class="form-control validate">
          <label data-error="x" data-success="v" for="local-search-input">关键词</label>
        </div>
        <div class="list-group" id="local-search-result"></div>
      </div>
    </div>
  </div>
</div>

    

    
  </main>

  <footer>
    <div class="footer-inner">
  
    <div class="footer-content">
       <a href="https://hexo.io" target="_blank" rel="nofollow noopener"><span>Hexo</span></a> <i class="iconfont icon-love"></i> <a href="https://github.com/fluid-dev/hexo-theme-fluid" target="_blank" rel="nofollow noopener"><span>Fluid</span></a> 
    </div>
  
  
  
  
</div>

  </footer>

  <!-- Scripts -->
  
  <script  src="https://lib.baomitu.com/nprogress/0.2.0/nprogress.min.js" ></script>
  <link  rel="stylesheet" href="https://lib.baomitu.com/nprogress/0.2.0/nprogress.min.css" />

  <script>
    NProgress.configure({"showSpinner":false,"trickleSpeed":100})
    NProgress.start()
    window.addEventListener('load', function() {
      NProgress.done();
    })
  </script>


<script  src="https://lib.baomitu.com/jquery/3.6.0/jquery.min.js" ></script>
<script  src="https://lib.baomitu.com/twitter-bootstrap/4.6.1/js/bootstrap.min.js" ></script>
<script  src="/js/events.js" ></script>
<script  src="/js/plugins.js" ></script>


  <script  src="https://lib.baomitu.com/typed.js/2.0.12/typed.min.js" ></script>
  <script>
    (function (window, document) {
      var typing = Fluid.plugins.typing;
      var subtitle = document.getElementById('subtitle');
      if (!subtitle || !typing) {
        return;
      }
      var text = subtitle.getAttribute('data-typed-text');
      
        typing(text);
      
    })(window, document);
  </script>




  
    <script  src="/js/img-lazyload.js" ></script>
  




  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/tocbot/4.18.2/tocbot.min.js', function() {
    var toc = jQuery('#toc');
    if (toc.length === 0 || !window.tocbot) { return; }
    var boardCtn = jQuery('#board-ctn');
    var boardTop = boardCtn.offset().top;

    window.tocbot.init({
      tocSelector     : '#toc-body',
      contentSelector : '.markdown-body',
      headingSelector : CONFIG.toc.headingSelector || 'h1,h2,h3,h4,h5,h6',
      linkClass       : 'tocbot-link',
      activeLinkClass : 'tocbot-active-link',
      listClass       : 'tocbot-list',
      isCollapsedClass: 'tocbot-is-collapsed',
      collapsibleClass: 'tocbot-is-collapsible',
      collapseDepth   : CONFIG.toc.collapseDepth || 0,
      scrollSmooth    : true,
      headingsOffset  : -boardTop
    });
    if (toc.find('.toc-list-item').length > 0) {
      toc.css('visibility', 'visible');
    }
  });
</script>


  <script src=https://lib.baomitu.com/clipboard.js/2.0.10/clipboard.min.js></script>

  <script>Fluid.plugins.codeWidget();</script>


  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/anchor-js/4.3.1/anchor.min.js', function() {
    window.anchors.options = {
      placement: CONFIG.anchorjs.placement,
      visible  : CONFIG.anchorjs.visible
    };
    if (CONFIG.anchorjs.icon) {
      window.anchors.options.icon = CONFIG.anchorjs.icon;
    }
    var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
    var res = [];
    for (var item of el) {
      res.push('.markdown-body > ' + item.trim());
    }
    if (CONFIG.anchorjs.placement === 'left') {
      window.anchors.options.class = 'anchorjs-link-left';
    }
    window.anchors.add(res.join(', '));
  });
</script>


  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/fancybox/3.5.7/jquery.fancybox.min.js', function() {
    Fluid.plugins.fancyBox();
  });
</script>


  <script>Fluid.plugins.imageCaption();</script>

  <script  src="/js/local-search.js" ></script>





<!-- 主题的启动项，将它保持在最底部 -->
<!-- the boot of the theme, keep it at the bottom -->
<script  src="/js/boot.js" ></script>


  

  <noscript>
    <div class="noscript-warning">博客在允许 JavaScript 运行的环境下浏览效果更佳</div>
  </noscript>
</body>
</html>
